/*编写一个程序，提示用户输入大写字母。使用嵌套循环以下面金字塔型的格式打印字母：
    A
   ABA
  ABCBA
 ABCDCBA
ABCDEDCBA
*/
#include<stdio.h>
int main(void){
    int i, j, num;
    char c;
    printf("Enter the core char you want to print(A...Z):");
    scanf("%c", &c);
    char ch = 'A';
    num = c - 'A' + 1;
    for ( i = 1; i <= num; i++)
    {
        for (j = 0; j < num - i; j++)
            printf(" ");
        for (ch = 'A'; j < num; j++)
            printf("%c", ch++);
        for (j = 1, ch -= 2; j < i; j++, ch--)
            printf("%c", ch);
        printf("\n");
    }
    return 0;
}